import { Injectable } from '@nestjs/common';

// @Injectable
export class UserService {
  //查询用户
  findUser(sid: string): string {
    console.log('user.service---', sid);
    if (sid === '123456') {
      return 'kid is here';
    } else {
      return 'No one Here';
    }
  }

  //设置Id
  setUser(sid: string, body: any): any {
    if (sid === '123456') {
      return { msg: '设置成功', body };
    } else {
      return { msg: 'id不符合规范,设置失败' };
    }
  }

  // 修改用户信息
  updateUser(sid: string, body: any): any {
    if (sid === '123456') {
      return { msg: '修改用户成功', body };
    } else {
      return { msg: '修改用户失败', body };
    }
  }

  //删除用户
  deleteUser(sid: string): any {
    if (sid === '123456') {
      return { msg: '删除成功' };
    } else {
      return { msg: '删除失败,id不符合规范' };
    }
  }
}
